/**
  author : sailing
  date : 2016-10-21
  fun: button
***/

<style lang="less">
  
</style>

<template>
  <div>
    <el-dialog title="关联业务" :visible.sync="isShow">
      <el-table :data="gridData">
        <el-table-column property="name" label="业务名称" width="300"></el-table-column>
        <el-table-column property="port" label="端口名称" ></el-table-column>
      </el-table>
    </el-dialog>
  </div>
</template>

<script>
import eventBus from '../../eventBus'
import fetchJson from '../../server/fetchJson'
import Config from '../../server/config'
import dataC from '../../server/data'
export default {
  data () {
    return {
      isShow: false,
      gridData: []
    }  
  },
  methods: {
    callback (response) {
      var d = response.data
      for(var i=0; i<d.length; i++) {
        d[i]["port"] = d[i]["port"].join(",")
      }
      this.gridData = d
    },
    error () {}
  },
  mounted () {
    const self = this

    eventBus.bus.$on('yTopo_panel', function (param) {
      self.isShow = true
      var _url = "/equipment/business/?id=" + Config.bizx
        fetchJson.getJson({
        self: self,
        url: _url,
        callback: self.callback,
        error: self.error
      })
    })
    
  },
  components: {}
}
</script>